/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.kungkhies.persistence.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author clayton
 */
@Embeddable 
public class KnodeActivityPK implements Serializable 
{
    @Basic(optional = false)
    @NotNull
    @Column(name = "kimpl_id")
    private long kimplId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "knode_id")
    private long knodeId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "activity_id")
    private long activityId;

    public KnodeActivityPK()
    {
    }

    public KnodeActivityPK(long kimplId, long knodeId, long activityId)
    {
        this.kimplId = kimplId;
        this.knodeId = knodeId;
        this.activityId = activityId;
    }

    public long getKimplId()
    {
        return kimplId;
    }

    public void setKimplId(long kimplId)
    {
        this.kimplId = kimplId;
    }

    public long getKnodeId()
    {
        return knodeId;
    }

    public void setKnodeId(long knodeId)
    {
        this.knodeId = knodeId;
    }

    public long getActivityId()
    {
        return activityId;
    }

    public void setActivityId(long activityId)
    {
        this.activityId = activityId;
    }

    @Override
    public int hashCode()
    {
        int hash = 0;
        hash += (int) kimplId;
        hash += (int) knodeId;
        hash += (int) activityId;
        return hash;
    }

    @Override
    public boolean equals(Object object)
    {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof KnodeActivityPK))
        {
            return false;
        }
        KnodeActivityPK other = (KnodeActivityPK) object;
        if (this.kimplId != other.kimplId)
        {
            return false;
        }
        if (this.knodeId != other.knodeId)
        {
            return false;
        }
        if (this.activityId != other.activityId)
        {
            return false;
        }
        return true;
    }

    @Override
    public String toString()
    {
        return "com.kungkhies.persistence.entities.KnodeActivityPK[ kimplId=" + kimplId + ", knodeId=" + knodeId + ", activityId=" + activityId + " ]";
    }

}
